package javasy;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class gui1 extends JFrame {
   public  String info="";
	
    public gui1(String str) throws IOException{
    	super(str);
        JFileChooser jfc=new JFileChooser(str);
        int status=jfc.showOpenDialog(null);
        if(status!=JFileChooser.APPROVE_OPTION)
        	fileEditor.setWords("没有选择文件");
        File file1=jfc.getSelectedFile();
        FileInputStream fin=new FileInputStream(file1);
        while(fin.available()>0){
        	info=info+(char)fin.read();
        }
        fin.close();
        fileEditor.setWords(info);
        } 
}


